<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL ?>/libs/sanpham/tmpl/detail/abc.css" /> 

<?php

	$urlhinhanh ='images/sanpham/hinhdaidien/'.$value['hinhdaidien'];

	if(is_file($urlhinhanh))
	{
		$hinhanh = BASE_URL.'/'.$urlhinhanh	;	
	}
	else
	{
		$hinhanh = BASE_URL.'/images/khongcohinh.jpg';
	}

?>
<div id="detail_product">
                	<h1 class="title_product"><?php echo $value['tensp']; ?></h1>
                    <div id="content_cat">
						<div class="hinhanhsanpham">
							<p class="img_product"><img id="hinhchinh" class="img_pro" src="<?php echo $hinhanh?>" alt="hinh-san-pham-<?php echo $value['tensp']; ?>" title="<?php echo $value['tensp']; ?>"/></p>
							<ul class="ul_img_product">
								<li><a href="javascript:;" onmouseover="changeimg('<?php echo $hinhanh?>')" ><img class="img_pro1" src="<?php echo $hinhanh?>" alt="<?php echo $value['tensp']; ?>" title="<?php echo $value['tensp']; ?>" /></a></li>
								<?php
										
											$dirname = "images/sanpham/$value[id]";
																					
											if (is_dir($dirname)) {
												
											
											
											
											
											$dir = opendir($dirname);

											$arrfile ="";
											while(false != ($file = readdir($dir)))
											{
												if(($file != ".") and ($file != ".."))
												{
													$tyle= explode(".", $file);
													$kieu = strtolower($tyle[1]);
													if($kieu == 'jpg' || $kieu == 'png' || $kieu == 'gif')
													{
														// echo("$file <br />");
														// $arrfile .= ",('".$file."')";
														$imgLink = BASE_URL.'/'.$dirname.'/'.$file;
														echo "<li><a href=\"javascript:;\" onmouseover=\"changeimg('$imgLink')\" >";
														echo "<img src='$imgLink' width='80px' height='70px'/>";													
														echo "</a></li>";	
													}
												
												}
											}
										}
								?>								
							</ul>

						</div>
						
						<div class="thongtinsanpham">
						<?php
						if($value['giagoc'] !='')
						{
						?>
							<p class="price_pro">Giá gốc: <span style="text-decoration: line-through;"><?php echo $value['giagoc']; ?></span></p>	
						<?php
						}
						?>
							<p class="price_pro">Giá bán: <?php echo $value['giaban']; ?></p>	
							<p class="text1">Mô tả</p>
								<div class="des_pro">
									<?php echo $value['motangan']; ?>
								</div>
								
							
							
						</div>
						<p class="text1">Chi tiết</p>
						<div class="baivietsanpham">
							<div id="jp-container" class="jp-container2">							
								<?php echo $value['motadaydu']; ?>	
							</div>
						</div>
						
						<?php
						if(trim($value['thongsokythuat']) !='')
						{
						?>
							<p class="text1">Thông số kỹ thuật</p>
							<div class="baivietsanpham">
								<div id="jp-container" class="jp-container2">							
									<?php echo $value['thongsokythuat']; ?>	
								</div>
							</div>
						<?php
						}
						?>							
                    </div>
                    
                </div>
				
<script type="text/javascript">
function changeimg(img)
{
	// alert(img);
	document.getElementById("hinhchinh").src = img;
}
</script>